{% extends "base.html" %}

{% block container_class_name %}error{% endblock %}
{% block container %}
<div class="content">
  <div class="container">
    <article class="inner bubble">
      <hgroup class="title">
        <h1><span>404</span>,对不起,您要找的页面不存在。</h1>
        <h2><a href="/">返回首页<i class="icon-arrow-right"></i></a></h2>
      </hgroup>
    </article>
  </div>
</div>
{% endblock %}

{% block js %}
<script>
  $(function(){
    if(window.location.hash) {
      $(window).scrollTop($(window).scrollTop() - 50);
    }
    $(document.body).delegate("a","click",function(){
      var hrefStr = $(this).attr("href");
      var reg = /.*#[a-z_A-Z]+$/;
      var isHash= reg.test(hrefStr);
      if(isHash){
        var hashStr =$(this).attr('href'); 
        var hashIds = hashStr.match(/#[a-z_A-Z]+$/);
        var pos = $(hashIds[0]).offset();
        $(window).scrollTop(pos.top - 50);
        return false;
      }
    });
  });
</script>
{% endblock %}
